package com.start_eternity.oasissafewalk.comment;
import lombok.Data;

/**
 * @author ZhangT
 *
 * Description: 通用返回类
 */
@Data
public class BaseResponse<T> {

    private int code;

    private T data;

    private String message;

    private String description;

    public BaseResponse(int code, T data, String message, String description) {
        this.code = code;
        this.data = data;
        this.message = message;
        this.description = description;
    }

    public BaseResponse(int code, T data, String message) {
        this(code, data,message,"");
    }

    public BaseResponse(int code, T data) {
        this(code, data,"","");
    }

    public BaseResponse(ErrorCode errorCode) {
        this(errorCode.getCode(), null,errorCode.getMessage());
    }

}
